package com.young.springdemo.service.proxy;

public class proxySearch extends Searcher {
    private RealSearch realSearch = new RealSearch();
    private MyLogger myLogger;
    private Validate validate;

    @Override
    public void serarch(String userId, String keyWord) {
        if (this.validate(userId)) {
            realSearch.serarch(userId, keyWord);
            this.log(userId);
        }
    }

    public boolean validate(String userId) {
        validate = new Validate();
        return validate.validate(userId);
    }

    public void log(String userId) {
        myLogger = new MyLogger();
        myLogger.log(userId);
    }


}
